<template>
  <el-card shadow="hover" class="product-info">
    <template #header> 设备状态 </template>
    <div class="info">
      <div class="info-item">
        <div class="info-label">运行</div>
        <div class="info-value"><countTo :startVal="0" :endVal="15" :duration="3000" /></div>
      </div>
      <div class="info-item">
        <div class="info-label">待机</div>
        <div class="info-value"><countTo :startVal="0" :endVal="2" :duration="3000" /></div>
      </div>
      <div class="info-item">
        <div class="info-label">故障</div>
        <div class="info-value"><countTo :startVal="0" :endVal="3" :duration="3000" /></div>
      </div>
    </div>
  </el-card>
</template>

<script setup>
import { CountTo } from 'vue3-count-to'
</script>

<style scoped>
.product-info {
  /* background: linear-gradient(to right, #8ec5fc, #e0c3fc); */
  background: linear-gradient(90deg, rgba(60, 150, 254, 1) 0%, rgb(84, 188, 233) 100%);
  /* background-image: linear-gradient(120deg, #77a5f0 0%, #66b8df 100%);*/
  /* background-image: linear-gradient(to left, #5ee7df 0%, #dcbcf0 100%); */
  color: white;
  width: 100%;
}

.info {
  display: flex;
  justify-content: space-between;
}

.info-item {
  flex: 1;
  text-align: center;
  margin-right: 20px; /* 添加右间距 */
}

.info-item:last-child {
  margin-right: 0; /* 最后一个项不添加右间距 */
}

.info-label {
  font-size: 14px;
  margin-bottom: 10px;
}

.info-value {
  font-size: 24px;
  font-weight: bold;
}
</style>
